package cn.itsource.ymcc.openfeign.fallback;

import cn.itsource.ymcc.common.result.JsonResult;
import cn.itsource.ymcc.openfeign.MediaFeignClient;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class MediaFeignClientFallbackFactory implements FallbackFactory<MediaFeignClient> {

    @Override
    public MediaFeignClient create(Throwable throwable) {
        return new MediaFeignClient() {
            @Override
            public JsonResult getList(Long chapterId) {
                return JsonResult.error("getList调用失败");
            }
        };
    }
}
